const getTimeDate = (dates) => {
  var today = dates ? new Date(dates) : new Date()

  // 获取当前日期
  var dateString =
    today.getFullYear() + "/" + (today.getMonth() + 1) + "/" + today.getDate()
  return {
    year: today.getFullYear(),
    month: today.getMonth() + 1,
    day: today.getDate()
  }
  // 显示日期
}

const getCurrentDate = () => {
  const currentDate = new Date()
  const currentYear = currentDate.getFullYear()
  const currentMonth = String(currentDate.getMonth() + 1).padStart(2, "0") //加1，因为月份是从@开始
  const currentDay = String(currentDate.getDate()).padStart(2, "0")
  const currentDateTime = `${currentYear}-${currentMonth}-${currentDay}`
  return currentDateTime
}
const HttpUrl = "https://haici.snooowball.cn/"
const getreadType = (e) => {
  switch (e) {
    case 1:
      return "单词"
      break
    case 2:
      return "语法"
      break
    case 3:
      return "解题方法"
      break
    case 4:
      return "文章"
      break
    case 5:
      return "音标"
      break
    case 6:
      return "拼读"
      break
  }
}
export { getTimeDate, HttpUrl, getreadType, getCurrentDate }
